<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
    <title>Vue 逆转消息</title>
    <script src="https://unpkg.com/vue"></script>
    <style>
        #app-5{
            text-align: center;
            background-color: whitesmoke;
            height:600px;
            margin: auto;
        }
    </style>
</head>
<body>
<div id="app-5">
    <h1>欢迎使用信息逆转</h1>
    <span>您输入的信息：</span><span>{{message}}</span><br><br>
    <input v-model="message"><br><br>
    <button  v-on:click="reverseMessage">逆转消息</button>
</div>
<script>
    var app5=new Vue({
        el:'#app-5',
        data:{
            message:'Hello Vue.js'
        },
        methods:{
            reverseMessage:function(){
                this.message=this.message.split('').reverse().join('')
            }
        }
    })
</script>
</body>
</html>